/*
 * @Author: czu_xy 3322566362@qq.com
 * @Date: 2025-07-03 18:14:00
 * @LastEditors: czu_xy 3322566362@qq.com
 * @LastEditTime: 2025-07-03 18:55:43
 * @FilePath: \MDK-ARMc:\Users\33225\Desktop\Examples\STM32F407_RTOS\Hareware\sys.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "sys.h"

void delay_ms(uint32_t time)
{
    int32_t temp;
    SysTick->LOAD = (uint32_t)16000 * time;
    SysTick->VAL = 0x00;
    SysTick->CTRL = 0x01;

    do
    {
        temp = SysTick->CTRL;
    } while ((temp & 0x01) && !(temp & (1 << 16)));

    SysTick->CTRL = 0x01;
    SysTick->VAL = 0x00;
}
